import { _decorator, Component, director, Node, NodeEventType } from 'cc';
import FaderManager from '../../Runtime/FaderManager';
import { SCENE_ENUM } from '../../Enums';
const { ccclass, property } = _decorator;

@ccclass('StartManager')
export class StartManager extends Component {
    protected onLoad(): void {
        FaderManager.Instance.fadeOut(1000);
        this.node.on(NodeEventType.TOUCH_END, this.startGame, this);
    }

    async startGame() {
        await FaderManager.Instance.fadeIn(300);
        director.loadScene(SCENE_ENUM.Battle);
    }
}

